/**
 * Created by xu on 2016/3/15.
 * 检测管段js
 */
function getInsSegByLine(id){
    var url=p_path+"/settings/pipe/inspSegement/getSegByLineIdForIns.json";
    var data={"id":id};
    var col=[
        {title:myTableOpt_.getCheckBox(null),width:"5%",align:"center",format:function(json){
            if ($("#jcPopupTitle").html()=='编辑检测管段'){
                if (json.insSegId==null||json.insSegId==''){
                    return myTableOpt_.getCheckBox(json.id)
                }else if ($("#jcgdID").val()==json.insSegId){
                    return myTableOpt_.getCheckBox(json.id,null,null,"active")
                }else {
                    return "";
                }

            }

            if (json.insSegId==null||json.insSegId==''){
                return myTableOpt_.getCheckBox(json.id)
            }
            return "";
            }

        },
        {title:"管段名称",name:"name",width:"10%",align:"center"},
        {title:"所属检测管段",name:"insSegName",width:"10%",align:"center"}
    ];

    $("#inspSegmentListByLine").initTable({
        url: url,
        columnData: col,
        maxHeightMode:true,
        onlyFirstPage:true,
        selectDataNow:false,
        afterLoadTable:function(){
            $("#inspSegmentListByLine td").css("height","15px").attr("height","15px");
            $("#inspSegmentListByLine tr").css("height","12px").attr("height","12px")
        }
    });
    $("#inspSegmentListByLine").selectDataAfterSetParm(data);
}